package com.item.util;

import java.lang.ref.WeakReference;
import java.util.WeakHashMap;

public class MobileLock {
	public static String USER_ACCOUNT_LOCK = "!@#$%^USER";
	
	private static final WeakHashMap<String, WeakReference<String>> s_manualCache =
		    new WeakHashMap<String, WeakReference<String>>();
	
	//for lock with uuid
	public static String manualIntern( final String str ) {
		final WeakReference<String> cached = s_manualCache.get( str );
		if ( cached != null ) {
		        final String value = cached.get();
		        if ( value != null )
		            return value;
		}
		s_manualCache.put( str, new WeakReference<String>( str ) );
		return str;
	}
}
